<template>
  <div>
    <el-container>
      <el-header id="A1">教 &nbsp练 &nbsp后 &nbsp台 &nbsp管 &nbsp理 &nbsp首 &nbsp页</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu :default-openeds="['1', '2']">
            <el-menu-item index="1"><a href="#/CoachInfo">个人信息</a></el-menu-item>
            <el-menu-item index="2"><a href="#/MyRemuse">我的简历</a></el-menu-item>
            <el-submenu index="3">
              <template slot="title"><i class="el-icon-setting"></i>管理</template>
              </el-menu-item-group>

              </el-menu-item-group>
              <el-menu-item-group title="招聘信息">
                <el-menu-item index="1-3" v-if="this.coach.coachState != '3'"><a
                    href="#/venueAllRecruit">场馆招聘信息</a></el-menu-item>
              </el-menu-item-group>

              <el-menu-item-group>
                <template slot="title">申请</template>
                <el-menu-item index="1-2" v-if="this.coach.coachState != '3'  "><a
                    href="#/CoachattestationVenue">入驻场馆申请</a></el-menu-item>
              </el-menu-item-group>


              <el-menu-item-group title="我的">
                <el-menu-item index="1-5" v-if="this.coach.coachState != '3'"><a href="#/CoachMyVenue">我的场馆
                  </a></el-menu-item>
                <!-- <el-menu-item index="1-6" v-if="this.coach.coachState != '3'"><a href="#/CoachMyTeaching">我的教学
                  </a></el-menu-item> -->
                <el-menu-item index="1-4" v-if="this.coach.coachState != '3'"><a href="#/CoachMyStudent">我的学员
                  </a></el-menu-item>
                <el-menu-item index="1-7" v-if="this.coach.coachState != '3'"><a href="#/MyCourse">我的团课
                  </a></el-menu-item>
                  <el-menu-item index="1-8" v-if="this.coach.coachState != '3'"><a href="#/CoachLeagueClassDeal">团课核销
                    </a></el-menu-item>
              </el-menu-item-group>
              </el-menu-item-group>
            </el-submenu>
            <el-menu-item index="5">
              <i class="el-icon-error"></i>
              <span slot="title"><a href="#/CoachLogin" @click="removeToken()">退出登录</a></span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>

  </div>
</template>

<script>
  export default {
    name: "CoachHome",
    data() {
      return {

        coach: {}
      }
    },
    methods: {
      removeToken(){
        localStorage.clear('token')
      },
      loadCoachInfo() {
        this.$http.get("/account/yCoach/loadCoachByToken").then(resp => {
          this.coach = resp.data.data
        })
      }
    },
    created() {
      this.loadCoachInfo()
    }
  }
</script>

<style>
  #A1 {
    font-size: 45px;
    font-family: '华文行楷';
  }

  .el-header {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
  }

  * {
    margin: 0;
    padding: 0;
  }
</style>
